<script type="text/javascript">
	wx.config({
		debug: false,
		appId: "{BEESCRM:$appid}",
		timestamp: "{BEESCRM:$timestamp}",
		nonceStr: "{BEESCRM:$noncestr}",
		signature: "{BEESCRM:$signature}",
		jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','hideOptionMenu','scanQRCode']
	});
	
	wx.ready(function(){
		var url = '{BEESCRM:$share_url}';
		var imgUrl = '{BEESCRM:$share_image}';
		var title = '{BEESCRM:$share_title}';
		var desc = '{BEESCRM:$share_desc}';
		var shareConfig = {
				title: title,
				desc: desc,
				link: url, 
				imgUrl: imgUrl, 
				success: function () { 
					share();
				},
			};
		wx.onMenuShareTimeline(shareConfig);
		wx.onMenuShareAppMessage(shareConfig);
	});
	
	var vote_id='{BEESCRM:$vote_id}';
	var from_user_id='{BEESCRM:$from_fans_id}';
	var origin='{BEESCRM:$origin}';
	var share_callback_url="/activity/vote/share/vote_id/"+vote_id+"/origin/"+origin+"/from_user_id/"+from_user_id;

	function share(){
		$.ajax({
			type:'get',
			dataType:'json',
			url:share_callback_url,
			success:function(data){
				/* if(data.url){
					location.href=data.url;
				} */
			}
		});
	}  
</script>
	